﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Dynamic.Core;
using Dynamic.Core.Attributes;
using Dynamic.Core.Utility;

namespace Dynamic.Testing.Common
{
    public class EnumUtilityTest
    {
        public static void Go()
        {
            //Console.WriteLine(EnumUtility<Test2>.GetValue("real time") + " ddd");
            //Console.WriteLine(EnumUtility<Test1>.DefaultValue);
            //Array arr = Enum.GetValues(typeof(Test1));
            //if (arr.GetEnumerator().MoveNext())
            //{
            //    int i = Convert.ToInt32(arr.GetEnumerator().Current);
            //}
            //Test2 t = EnumUtility<Test2>.Parse("CN,US");
        }
    }

    [EnumType(DisplayName = "测试1", Name = "Test1")]
    public enum Test1
    {
        [EnumValue(DisplayName = "男", Name = "Man")]
        Man,

        [EnumValue(DisplayName = "女", Name = "Woman",IsDefault=true)]
        Woman,
    }

    [Flags]
    [EnumType(DisplayName = "测试2", Name = "Test2")]
    public enum Test2
    {
        [EnumValue(DisplayName = "中国", Name = "CN")]
        CN = 1,

        [EnumValue(DisplayName = "美国", Name = "US")]
        US = 2,

        [EnumValue(DisplayName = "英国", Name = "UK")]
        UK = 4,
        RealTime,
    }
}
